Skip to content

[DRAFT] virtio: add virtiofs #86768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

fkokosinski
Copy link
Member

This PR:

  • adds virtiofs functions and required fuse structures
  • implements zephyr filesystem operations for virtiofs
  • adds virtiofs sample that presents use of this filesystem

Note that this draft PR uses the VIRTIO PCI driver implemented in #83892, and is meant to showcase how the VIRTIO PCI driver can be used with Zephyr.

@cfriedt
Copy link
Member

cfriedt commented Apr 7, 2025

@fkokosinski -

Looks very good so far.

Is it possible to separate the virtiofs and fuse contributions into separate commits? I think they can be used independently - e.g. network based FUSE.

I was initially searching for the separation between host and device roles under drivers/virtio, but now it's a bit more clear that drivers/virtio is mainly for common components and host and device drivers will live under their respective subsystems.

Maybe slightly different naming would make it easier to differentiate which is the host driver and which is the device between e.g. with virtiofs.c and virtiofs_zvfs.c, maybe virtiofs_host.c and virtiofs_device.c. Naming things is hard though, so it's maybe good to discuss. Additionally, different subsystems have different naming conventions for things, but it would be nice to have some cross-subsystem naming.

Given that it might be hard to identify all of the different virtio drivers that will eventually be scattered throughout Zephyr, and which might do the host side vs device side, I would also like to see a new section in the documentation.

  • maybe place things under doc/hardware/virtualization
  • good high-level topics
    • Overview
    • Concepts (an SVG diagram would go a long way here)
    • Common VirtIO libraries
    • Host-side VirtIO drivers
    • Device-side VirtIO drivers
    • VirtIO Samples

Happy to help move this along any way I can.

This commit adds the API for accessing VIRTIO devices, and adds a driver
for a VIRTIO PCIE device based on the newly added API.

This commit is based on the Virtual I/O Device (VIRTIO) Version 1.3
specification:
https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.pdf

Signed-off-by: Jakub Michalski <[email protected]>
Signed-off-by: Filip Kokosinski <[email protected]>
This commit adds virtio section in documentation, describing
virtio-related concepts

Signed-off-by: Jakub Michalski <[email protected]>
Signed-off-by: Filip Kokosinski <[email protected]>
This commit adds a build test for the VIRTIO PCI device.

Signed-off-by: Jakub Michalski <[email protected]>
Signed-off-by: Filip Kokosinski <[email protected]>
This commit adds virtio section in documentation, describing
virtio-related concepts

Signed-off-by: Jakub Michalski <[email protected]>
This commit adds fuse structures, requests and functions to fill them

Signed-off-by: Jakub Michalski <[email protected]>
This commit adds virtiofs functions implementing fuse operations required
to enable zephyr filesystem support

Signed-off-by: Jakub Michalski <[email protected]>
This commit implements zephyr filesystem operations for virtiofs

Signed-off-by: Jakub Michalski <[email protected]>
Signed-off-by: Filip Kokosinski <[email protected]>
This commit adds virtiofs sample that presents use of this filesystem

Signed-off-by: Jakub Michalski <[email protected]>
Signed-off-by: Filip Kokosinski <[email protected]>
This commit adds sections to the virtio docs with the currently
supported transfer methods, drivers and samples

Signed-off-by: Jakub Michalski <[email protected]>
@fkokosinski
Copy link
Member Author

Hey @cfriedt, thanks for your comment!

I believe all of your remarks have been addressed in the recent push (here and in the VIRTIO PCI API PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants